package com.erp.mapper;

import cn.hutool.json.JSONObject;
import com.erp.entity.MyUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.erp.entityVo.MyUserVo;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author  CJ 
 * @since 2021-10-09
 */
public interface MyUserMapper extends BaseMapper<MyUser> {
    /*
    通过用户名判断用户是否存在
     */
    MyUser checkUserExists(String userName);
    /*
    获取用户
     */
    Map<String,Object> getUser(String id);
    /*
    修改用户数据
     */
    int updateUser(JSONObject data);
    /*
    通过用户名获取用户
     */
    @Select("select * from my_user t where t.user_name = #{userName}")
    MyUser getUserByName(String userName);

    @Select("select * from my_user t where user_id = #{id}")
    MyUser getUserPwd(String id);
}
